package com.pureut.quality.controller;

import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.page.TableDataInfo;
import com.pureut.quality.domain.dto.QualitySchemeConfigurationDetailDto;
import com.pureut.quality.domain.dto.QualitySchemeConfigurationDto;
import com.pureut.quality.domain.vo.QualitySchemeConfigurationVo;
import com.pureut.quality.service.QualitySchemeConfigurationDetailService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/***
 * 检验方案配置明细控制层
 * Author:C
 * Date:2023/02/03 9:33
 * @DESC
 */
@RestController
@RequestMapping("/quality-scheme-configuration-detail")
public class QualitySchemeConfigurationDetailController extends BaseController {

    @Resource
    QualitySchemeConfigurationDetailService qualitySchemeConfigurationDetailService;

    /**
     * 检验方案配置明细列表
     */
    @GetMapping("/list")
    public TableDataInfo getList(long id) {
        startPage();
        //查询检验方案配置列表
        List<QualitySchemeConfigurationDetailDto> list = qualitySchemeConfigurationDetailService.getSchemeConfigurationDetailList(id);
        return getDataTable(list);
    }

    /**
     * 根据项目编码查询信息
     */
    @GetMapping("/getViewByItemCode")
    public TableDataInfo getViewByItemCode(String itemCode) {
        startPage();
        //查询检验方案配置列表
        List<QualitySchemeConfigurationDetailDto> list = qualitySchemeConfigurationDetailService.getViewByItemCode(itemCode);
        return getDataTable(list);
    }
}
